package com.xlj.dao;

import com.xlj.pojo.User;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class userMapperparactice implements userMapper {
private SqlSessionTemplate sessionTemplate;

    public userMapperparactice() {
    }

    public userMapperparactice(SqlSessionTemplate sessionTemplate) {
        this.sessionTemplate = sessionTemplate;
    }

    public void setSessionTemplate(SqlSessionTemplate sessionTemplate) {
        this.sessionTemplate = sessionTemplate;
    }

    @Override
    public List<User> getAll() {
        return sessionTemplate.selectList("com.xlj.dao.userMapper.getAll");
    }

    @Override
    public List<User> getAlls() {
        return sessionTemplate.getMapper(userMapper.class).getAlls();
    }

    @Override
    public List<User> getAllrole() {
        return sessionTemplate.selectList("com.xlj.dao.userMapper.getAllrole");
    }

    @Override
    public List<User> getuaddress() {
        return sessionTemplate.selectList("com.xlj.dao.userMapper.getuaddress");
    }

    @Override
    public Integer addnewUser(User user) {
        return sessionTemplate.getMapper(userMapper.class).addnewUser(user);
    }
}
